/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.util.ArrayList;

/**
 *
 * @author ivyduk
 */
public class Order {


    private String NameCustomer;
    private String AddressCustomer;
    private double deliverytime;
    private double price;
    private ArrayList<Hardwood> hardwoodArray = new ArrayList<Hardwood>();
    
    
        public String getAddressCustomer() {
        return AddressCustomer;
    }

    public void setAddressCustomer(String AddressCustomer) {
        this.AddressCustomer = AddressCustomer;
    }

    public String getNameCustomer() {
        return NameCustomer;
    } 

    public void setNameCustomer(String NameCustomer) {
        this.NameCustomer = NameCustomer;
    }
    public double getDeliverytime() {
        return deliverytime;
    }

    public void setDeliverytime(double d) {
        deliverytime=d+deliverytime;
    }

    public ArrayList<Hardwood> getHardwoodArray() {
        return hardwoodArray;
    }

    public void setHardwoodArray(ArrayList<Hardwood> hardwoodArray) {
        this.hardwoodArray = hardwoodArray;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double p) {
        price=p+price;
    }
    //adiciona el objeto a la lista de la orden
    public void addHardwood(Hardwood h,int cantidad){
        hardwoodArray.add(h);
        h.setAmount(cantidad);
    }
    public void imprimirorden(){
        System.out.println("Cliente: "+NameCustomer);
        System.out.println("Dirección:  "+AddressCustomer);
        System.out.println("------------------------------------");
        for(Hardwood h:hardwoodArray){
            System.out.println("Tipo de Madera:  "+h.getType());
            System.out.println("Tiempo de envío c/u:  "+Double.toString(h.getDeliverytime())+" horas");
            System.out.println("Costo c/u:  US$ "+Double.toString(h.getPrice()));
            System.out.println("Costo Madera:  US$ "+Double.toString(h.getPrice()*h.getAmount()));
            System.out.println("Unidades solicitadas: "+Integer.toString(h.getAmount()));
            System.out.println(" ");
        }
        System.out.println("------------------------------------");
        System.out.println("Precio total del pedido: US$ "+Double.toString(price));
        System.out.println("Tiempo total envío: "+Double.toString(deliverytime)+" horas");
    }
}
